import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Login from '../views/login.vue'
import Home from '../views/home.vue'
import SceneManage from '@/components/sceneManager.vue'
import BlackWhiteManager from '@/components/blackWhiteManager.vue'


const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Login',
    component: Login,
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children:[
      {
        path: '/sceneManager',
        name: 'sceneManager',
        component: SceneManage
      },
      {
        path: '/blackWhiteManager',
        name: 'blackWhiteManager',
        component: BlackWhiteManager
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/login.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
